#ifndef INTSOURCE_H_
#define INTSOURCE_H_

#include "Source.h"
#include "Sink.h"
#include "StringPiece.h"

class IntSource : public Source<int> {
    Source<StringPiece> *lineSource;
    
public:
    IntSource(Source<StringPiece> *src) : lineSource(src) {}

    void feedTo(Sink<int> *sink);
};

class SinkIntAdapter : public Sink<StringPiece> {
    Sink<int> *m_sink;

public:
    SinkIntAdapter(Sink<int> *sink) : m_sink(sink) {}

    virtual void process(StringPiece);
    virtual const char *finish();
};

#endif
